<template>
	<view>
		<uni-list>
			<uni-list-item v-for="(item, index) in staffFission" :key="index" clickable @click="gotoFissionDetail(item)">
				<!-- 自定义 header -->
				<template v-slot:header>
					<view style="display: flex; align-items: center">
						<view>{{ (item.info?.orName || '')}}</view>
						<view>{{ '-'+ (item.info?.orPhon || '') }}</view>
					</view>
				</template>
				<!-- 自定义 footer-->
				<template v-slot:footer>
					<view style="display: flex; align-items: center;">
						<view style="margin-bottom: 3px;">裂变订单:{{ item?.sfShao || 0 }}</view>
						<uni-icons type="forward" size="20" color="#C0C0C0"></uni-icons>
					</view>
				</template>
			</uni-list-item>
		</uni-list>
	</view>
</template>

<script>
	import {
		mapGetters
	} from "vuex";
	import {
		getAllStaffFissionByOsUuid
	} from "../../utils/api.js"
	export default {
		data() {
			return {
				staffFission: []
			}
		},
		onLoad(params) {
			if (params.osUuid) {
				this.loadStaffFission({osUuid: params.osUuid, gpUuid: this.activity.gpUuid })
			}
		},
		computed: {
			...mapGetters({
				activity: "activityInfo/activity",
			}),
		},
		methods: {
			async loadStaffFission({osUuid, gpUuid}) {
				let res = await getAllStaffFissionByOsUuid({
					osUuid,
					gpUuid,
				});
				if (res) this.staffFission = res
			},
			gotoFissionDetail(item) {
				uni.navigateTo({
					url: `/pages/boss/staff_fission_detail?orUuid=${item.orUuid}`
				})
			}
		}
	}
</script>

<style>
</style>